package com.itheima.mylinkedlist;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;

/*
代码描述一个栈,先进后出
 */
public class Demo1 {
    public static void main(String[] args) {
        try{
            int [] arr = {1,2,3,4,5};
            System.out.println(arr[5]);
        }catch (NullPointerException e){
            System.out.println("异常出现了");
        }
        System.out.println("程序结束");
}
class Student{
    private String name;
    private  int age;

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
class Person {
    private String name;
    private int age;

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}}